#include "widget.h"
#include "ui_widget.h"
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);


}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_add_clicked()
{
    float ret = this->windowOpacity();
    ui->pushButton_add->setShortcut(QKeySequence("w"));
    if(ret>=1)
    {
        return;
    }
    qDebug()<<ret;
    ret+=0.1;
    this->setWindowOpacity(ret);
}

void Widget::on_pushButton_sub_clicked()
{
    float ret = this->windowOpacity();
    ui->pushButton_sub->setShortcut(QKeySequence("s"));
    if(ret<0)
    {
        return;
    }
    qDebug()<<ret;
    ret-=0.1;
    this->setWindowOpacity(ret);
}
